/*
 * @Author: chenr 526963089@qq.com
 * @Date: 2023-02-10 10:19:22
 * @LastEditors: chenr 526963089@qq.com
 * @LastEditTime: 2023-02-13 16:55:11
 * @Description:
 */
import { fileURLToPath, URL } from 'node:url';
// import { resolve } from 'node:path';

import { defineConfig } from 'vite';
import vue from '@vitejs/plugin-vue';
import vueJsx from '@vitejs/plugin-vue-jsx';

// https://vitejs.dev/config/
export default defineConfig({
  plugins: [vue(), vueJsx()],
  resolve: {
    alias: {
      '@': fileURLToPath(new URL('./src', import.meta.url)),
      '@official': fileURLToPath(
        new URL('./src/src-official', import.meta.url)
      ),
      '@portal': fileURLToPath(new URL('./src/src-portal', import.meta.url)),
      '@read': fileURLToPath(new URL('./src/src-read', import.meta.url)),
    },
  },
  css: {
    preprocessorOptions: {
      less: {
        javascriptEnabled: true,
      },
    },
  },
  server: {
    port: 8080,
    // proxy: {
    //   '/api': {
    //     target: 'http://172.16.6.100/',
    //     changeOrigin: true,
    //     rewrite: (path) => path.replace(/^\/api/, "")
    //   },
    // },
  },
});
